#!/bin/sh
#
# build -- Build the docker image for the lab
#
# Copyright (C) 2016-2020 Wu Zhangjin <lzufalcon@163.com>
#
# ref: https://docs.docker.com/engine/installation/linux/ubuntulinux/
#
# E.g. LAB_CACHE=0 tools/docer/build
#

uname | grep -q MINGW && PWD_OPT="-W"
TOP_DIR="$(cd "$(dirname "$0")"/../../ && pwd $PWD_OPT)"
. "$TOP_DIR/tools/docker/config" $* >/dev/null

[ -n "$LAB_CACHE" -a "x$LAB_CACHE" = "x0"  ] && NO_CACHE="--no-cache"

do_op "docker build $NO_CACHE -t " IMAGE "'$CONFIG_DIR'"
